package com.yhos.platform.oopston.core.rest;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestCallConfig {

    @Bean
    public RestTemplate restTemplate() {
        //return new RestTemplate(new HttpsClientRequestFactory());
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getMessageConverters().add(new OopstonFastJsonHttpMessageConvert());
        return restTemplate;
    }

    @Bean
    public RestCall restClient(RestTemplate restTemplate) {
        RestCall restClient = new RestCall();
        restClient.setRestTemplate(restTemplate);
        return restClient;
    }

}
